package com.thread.threadfirst.rabbitMQPublisher.publisher;

import com.thread.threadfirst.ThreadFirstApplication;
import com.thread.threadfirst.rabbitMQPublisher.constant.AMQPConstant;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.stereotype.Component;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = ThreadFirstApplication.class)
public class PublisherFirstByteToIntTest {

    @Autowired
    private PublisherFirst publisherFirst;
    @Autowired
    DLXPublisher dlxPublisher;

    @Test
    public void sendTest() {
//        String result1=publisherFirst.send1(AMQPConstant.EXCHANGE_TOPIC_FIRST,"topic.He","can't forget you.");
//        System.out.println(result1);
//        String result2=publisherFirst.send1(AMQPConstant.EXCHANGE_TOPIC_FIRST,"first.topic.third.fourth","hello first from Hejuan.");
//        System.out.println(result2);
//        //fanout exchange
//        String result3=publisherFirst.send1(AMQPConstant.EXCHANGE_FANOUT_FIRST,"","You deserve better.");
//        System.out.println(result3);

//        String result = publisherFirst.send1(AMQPConstant.EXCHANGE_TOPIC_FIRST, "he.topic.he.he", 1000);
//        System.out.println(result);

        //死信队列
        dlxPublisher.send(100);
    }
}
